<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>职位信息详情</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/vendor/bootstrap/css/bootstrap.min.css">

</head>
<body>
<center><h1>职位信息详情</h1></center>
<hr>
<h2>职位相关信息：</h2>
职位名称:${position.name}<br>
职责说明:${position.duty}<br>
能力要求:${position.ability}<br>
薪资:${position.salary1 }- ${position.salary2 }<br>
发布时间:<fmt:formatDate value="${position.releaseTime }" pattern="yyyy-MM-dd HH:mm:ss"/><br>
<h2>公司相关信息</h2>
企业名称:${position.company$name }<br>
企业邮箱:${position.company$email }<br>
联系电话:${position.company$phone }<br>
联系人: ${position.company$linkman }<br>
联系地址:${position.company$address }<br>
人数:${position.company$numbers }<br>
服务宗旨:"${position.company$slogan }"<br>
		<c:if test="${empty application }">
			<select id="resume">
				<option value="">-请选择简历-</option>
				<c:forEach items="${resumeList }" var="resume">
					<option value="${resume.id }">${resume.intention }</option>
				</c:forEach>
			</select>
			<button class="btn btn-primary" onclick="apply();">投个简历</button>
		</c:if>
		<c:if test="${!empty application }">
			<span class="label label-success">此职位已投递，目前审核状态：${application.statusStr }</span>
		</c:if>
		<button class="btn btn-default" onclick="location='<%=request.getContextPath() %>/PositionServlet?command=list'">返回招聘首页</button>
		
		<script src = "<%=request.getContextPath()%>/vendor/jquery.min.js"></script>
		<script src = "<%=request.getContextPath()%>/vendor/bootstrap/js/bootstrap.min.js"></script>
		<script>
			
			function apply() {
				 var resumeId = document.getElementById('resume').value;
				 if (resumeId == '') {
					 alert('请先选择简历，再执行职位投递!');
				 } else {
					 location='<%=request.getContextPath() %>/ApplicationServlet?command=apply&resumeId=' + resumeId + '&positionId=${position.id}'
				 }
			}		 
		</script>
	</body>
</html>